package com.zhou.project.modules.circle.circleGroup.dao;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zhou.project.modules.circle.circleGroup.entity.CircleGroup;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.ResultType;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface CircleGroupDao extends BaseMapper<CircleGroup> {

    @Select("select id,name,introduce from ucc_circle_type where circle_id=#{id}")
    @ResultType(CircleGroup.class)
    List<CircleGroup> queryGroupByTypeId(int TypeId);

    @Delete("delete from ucc_circle_type where id=#{id}")
    int delete(int id);

    @Select("select count(*) from ucc_user_circle where user_id=#{id}")
    long countPeople(int id);

    @Select("SELECT count(*) FROM ucc_circle_type_posts where circle_type_id=#{id}")
    long countPosts(int id);
}
